package com.jrx.anytxn.reporting.job.lsSecondFile.step;

import com.jrx.anytxn.transaction.constant.TransBizConstant;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;

import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 生成第二代征信个人借据信息 Reader
 *
 * @author liuyang
 * @date 2021-04-26
 */
public class LSSecondAccountFileReader extends MyBatisPagingItemReader<String> {
    public LSSecondAccountFileReader(SqlSessionFactory sqlSessionFactory, Integer pageSize, Date startTime) {
        setSaveState(false);
        setPageSize(pageSize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.transaction.mapper.ext.ExtAmLoanAccountInfoMapper.selectLoanIdByStatus");
        Map<String, Object> map = new HashMap<>();
        map.put("statusList", Arrays.asList(TransBizConstant.LOAN_STATUS_1, TransBizConstant.LOAN_STATUS_2,
                TransBizConstant.LOAN_STATUS_7, TransBizConstant.LOAN_STATUS_8, TransBizConstant.LOAN_STATUS_6));
        map.put("startTime", startTime);
        setParameterValues(map);
    }
}
